package com.gzhryc.shared_device.cdcz.code.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.JoinField;
import com.gzhryc.jdbc.annotaion.PrimaryKey;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.cdcz.code.dao.enums.ChargeSocketSlotEnum;
import com.gzhryc.shared_device.cdcz.core.enums.ECDCZPlugOverloadState;
import com.gzhryc.shared_device.cdcz.core.enums.ECDCZPlugPowerState;
import com.gzhryc.shared_device.cdcz.core.enums.ECDCZPlugTemperatureState;

import java.io.Serializable;
import java.util.Date;

/**
 * 充电宝机柜卡槽
 * @version 2022-09-09
 */
@Table(name = "dev_charge_socket_slot")
public class ChargeSocketSlot implements Serializable {

    private static final long serialVersionUID = 1L;

	@PrimaryKey
    @Column(notNull = true,name = "device_sn")
    protected String deviceSn;

    @PrimaryKey
    @Column(notNull = true,name = "slot_num")
    protected Integer slotNum;

    @Column(name="overload_state",notNull = true, defVal = "1", note = "过载状态")
    protected Integer overloadState;

    @Column(name="temperature_state",notNull = true, defVal = "1", note = "温度状态")
    protected Integer temperatureState;

    @Column(name="power_state",notNull = true, defVal = "0", note = "通电状态")
    protected Integer powerState;

    @Column(notNull = true, defVal = "1", note = "卡槽状态")
    protected Integer state;

    @Column(name="current_trade_no", note = "当前订单号")
    protected String currentTradeNo;

    @Column(name = "update_date", autoUpdateTime = true, note = "最后修改时间")
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @JoinField(name = "iot_node_id",fromField = "device_sn",toTable = "dev_charge_socket",toField = "device_sn")
    protected Long iotNodeId;

    @JoinField(name = "state",fromField = "device_sn",toTable = "dev_charge_socket",toField = "device_sn")
    protected Integer chargeSocketState;

    public String getDeviceSn() {
        return deviceSn;
    }

    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }

    public Integer getSlotNum() {
        return slotNum;
    }

    public void setSlotNum(Integer slotNum) {
        this.slotNum = slotNum;
    }

    public Integer getOverloadState() {
        return overloadState;
    }

    public void setOverloadState(Integer overloadState) {
        this.overloadState = overloadState;
    }

    public Integer getPowerState() {
        return powerState;
    }

    public void setPowerState(Integer powerState) {
        this.powerState = powerState;
    }

    public Integer getTemperatureState() {
        return temperatureState;
    }

    public void setTemperatureState(Integer temperatureState) {
        this.temperatureState = temperatureState;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getCurrentTradeNo() {
        return currentTradeNo;
    }

    public void setCurrentTradeNo(String currentTradeNo) {
        this.currentTradeNo = currentTradeNo;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getStateName(){
        return ChargeSocketSlotEnum.State.note(this.state);
    }

    public String getOverloadStateName(){
        return ECDCZPlugOverloadState.note(this.overloadState);
    }

    public String getTemperatureStateName(){
        return ECDCZPlugTemperatureState.note(this.temperatureState);
    }

    public String getPowerStateName(){
        return ECDCZPlugPowerState.note(this.powerState);
    }

    public Long getIotNodeId() {
        return iotNodeId;
    }

    public void setIotNodeId(Long iotNodeId) {
        this.iotNodeId = iotNodeId;
    }

    public Integer getChargeSocketState() {
        return chargeSocketState;
    }

    public void setChargeSocketState(Integer chargeSocketState) {
        this.chargeSocketState = chargeSocketState;
    }
}
